Summer '08
As of this writing, I’ve just finished and sent off my last term paper this quarter1. I’ve also just realized that I’m officially on summer break now. This means I should probably explain what I’m going to be doing.
Last year, I took an internship at Microsoft. It was an interesting experience, but I wanted to try something different this year. This is pretty much the only time of my life I can take a job at a different company every year and not look like a terrible employee, so I’m taking full advantage of that.
The first day of my first non-intro-track Computer Science course, Software Design and Development, the instructor handed each of the students a binder full of useful documents ranging from concrete topics like the differences between C#/.NET and Java2 to more abstract topics like UI design. In the latter category were several essays from Joel on Software.
Haml 2.0
Haml 2.0 has been released. We’re calling it Friendly Fred because it aims to please. By the time you read this, it’ll probably have hit all the gem mirrors, so you can get it immediately.
So what’s new?
Friendliness
Haml Whitespace-Handling Sucks, Too
I want to thank everyone who replied to my last post and told me everything that was wrong with Haml error messages. I think I’ve fixed everything that was mentioned there, but if something else comes up please let me know.
I was surprised to learn that most of the problems were with line number inaccuracies and the error not managing to bubble up through Rails properly. I was going to do a similar post for Sass, but since it doesn’t seem to have the same issues, I think I’ll skip it.
Instead, I thought we could do some brainstorming. Haml’s been missing an important bit of functionality for a while now. Although it’s powerful enough to express almost everything you can with plain XHTML, Haml isn’t good at not producing whitespace.
Haml Errors Suck
I love it when people rant about Haml and Sass. As wonderful as positive feedback is (and I love that, too), criticism is golden. Hearing what people hate about these programs is hands-down the best way to figure out how to improve them.
For example, people hated that Haml was so much slower than ERB.
It’s not any more1.
People hated that it was so annoying to format whitespace-sensitive HTML elements like textarea and pre.
This will “just work” as of the next major release.
Unfortunately, there’s one major issue I haven’t been able to fix. I’ve heard over and over again on blog posts and Twitter that people just can’t understand Haml’s and Sass’s error messages.
Git-Style Automatic Paging in Ruby
I was using Chris Wanstrath’s cheat the other day, seeing if there were any cool git features I was missing out on (did you know you can color the output?). If you haven’t come across it yet, cheat is a nice little Ruby utility that displays “cheat sheets”— user-generated pages of text that serve as miniature reference manuals.
Unfortunately, some of these cheat sheets can get pretty long.
The git one is 228 lines.
Some of the text went off the top of my terminal.
I sighed and typed in cheat git | less,
thinking once again how nice it would be if more programs followed git’s example
and automatically paged their output.
Although git’s not usually held up as a paragon of usability1,
there are a few places where it shines.
My favorite is how it’ll run less on its output
when the output is too big to fit on my terminal screen.
Then I can easily scroll and search through the text.
Since I had a bit of time with nothing urgent to do, I decided to take a crack at making cheat page like git. Two and a half hours later, after digging through git’s source, getting help from the good folks in #git and #ruby-lang on Freenode, and receiving tons of bug fixes from Kevin Ballard, I got it to work.
Putting it in Perspective
One of my favorite features of wmii is tags1. These allow you to divide up windows into categories based on whatever you want.
The basic idea is really simple. Each window has a set of strings associated with it, called its “tags.” At any given moment, you are “viewing” a single tag. This means that only windows with that tag are displayed.
What’s more, each tag has a certain configuration of windows. This means that I can have Firefox in the upper-left corner for my programming tag but taking up the whole screen for my web tag.
About Me
Feed
3 Comments
More
Older Posts

